<?php
declare (strict_types=1);

namespace app\data\model;


/**
 * @mixin \think\Model
 */
class ProductsFieldsModel extends BaseModel
{
    protected $table = 'ctmon_products_fields';
    protected $pk = 'id';

    protected $schema = [
        'id' => 'bigint',
        'name' => 'varchar',
        'sort' => 'int',
        'is_show' => 'int',
        'ver' => 'bigint',
        'create_time' => 'int',
        'update_time' => 'int',
        'delete_time' => 'int',
    ];

    public function productsCategoryList()
    {
        return $this->belongsToMany(ProductsCategoryModel::class,ProductsCategoryFieldsRelationshipModel::class,'cat_id','field_id');
    }
}
